package io.sdph.controller;

import io.sdph.userprofile.ISessionManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;


/**
 * Servlet odpowiedzialny za mozliwosc zamowienia wizyty przedstawiciela handlowego w panelu klienta (client.jsp)
 *
 * @author MODUL FRONTU (WWW)
 */
@Controller
@RequestMapping("/orderVisit")
public class ClientOrderVisit {
       
        private static final String SALES_REPRESENTATIVE = "salesRep";
        private static final String SELECTED_DATE_DAY = "orderDay";
        private static final String SELECTED_DATE_MONTH = "orderMonth";
        private static final String SELECTED_DATE_YEAR = "orderYear";
        private static final String ANOTHER = "all";
       
        private static final String PAGE_VIEW = "client";

        /** Komponent pomocniczy do zarz�dzania sesj� u�ytkownika. */
        @Autowired
        ISessionManager sessionManager;
       
        //HttpServletRequest arg0, HttpServletResponse arg1
        @RequestMapping(method=RequestMethod.GET)
        public ModelAndView showPage() throws Exception {
               
                ModelAndView model = new ModelAndView(PAGE_VIEW);
 
                return model;
        }
       
        @RequestMapping(method=RequestMethod.POST)
        public ModelAndView orderVisit(
                        @RequestParam(SALES_REPRESENTATIVE) final String salesRepresentative,
                        @RequestParam(SELECTED_DATE_DAY) final String orderDay,
                        @RequestParam(SELECTED_DATE_MONTH) final String orderMonth,
                        @RequestParam(SELECTED_DATE_YEAR) final String orderYEAR                        
        				) {
               
                ModelAndView model = new ModelAndView(PAGE_VIEW);
                              

                return model;
        }
       
}
